<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function isZhi(n) {
            var flag = true;
            for (var i=2; i<n; i++) {
                if (n%i === 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }
        console.log(isZhi(7));
    </script>
</body>
</html>